#include "msg.h"
#include <string.h>

namespace base {

	SendMsg::SendMsg(const char* data, size_t datasize)
	{
		memcpy(_data, data, datasize);
		_datasize = datasize;
		_data[datasize] = '\0';
	}

	SendMsg::SendMsg( const SendMsg& other )
	{
		memcpy(this->_data, other._data, other._datasize);
		this->_datasize = other._datasize;
		_data[other._datasize] = '\0';
	}


	SendMsg::~SendMsg()
	{
	}

	SendMsg& SendMsg::operator=( const SendMsg& other )
	{
		memcpy(this->_data, other._data, other._datasize);
		this->_datasize = other._datasize;
		_data[other._datasize] = '\0';
		return *this;
	}

	char* SendMsg::getData()
	{
		return _data;
	}

	size_t SendMsg::getDataSize() const
	{
		return _datasize;
	}

}
